{extend name="Layout/datagrid" /}
{block name="content_header"}        
<h1>
    过滤设置
    <small>advanced tables</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="#">安全</a></li>
    <li class="active">过滤设置</li>
</ol>
{/block}
{block name="content"}
<div class="box">
    <!-- /.box-header -->
    <div class="box-body">
        <div class="row">
            <div class="col-md-6">
                <!-- form start -->
                <form action="{:url('editSave')}" method="post" class="form-horizontal">
                    <div class="box-body">
                        {foreach name="list" item="vo"}
                        <div class="form-group">
                            <label class="col-sm-2 control-label">{$vo.title}</label>
                            <div class="col-sm-10">
                                <div class="btn-group btn-group-justified">
                                    <div class="btn-group">
                                        <div class="input-group">
                                            <input type="number" name="question1" class="form-control input-sm" value="{$data.minute|default=3}" placeholder="分钟" required="required" />
                                            <span class="input-group-addon">分钟内超过</span>
                                            <input type="number" name="question1" class="form-control input-sm" value="{$data.question1|default=10}" placeholder="次" required="required" />
                                            <span class="input-group-addon">次则禁用</span>
                                            <select name="punishment" class="form-control input-sm">
                                                <option value="5">5分钟</option>
                                                <option value="10" selected="selected">10分钟</option>
                                                <option value="30">半小时</option>
                                                <option value="60">1小时</option>
                                                <option value="720">12小时</option>
                                                <option value="1440">24小时</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="btn-group" style="left:10px;">
                                        <div class="input-group">
                                            <span class="input-group-addon">每天超过</span>
                                            <input type="number" name="question1" class="form-control input-sm" value="{$data.question1|default=10}" placeholder="次" required="required" />
                                            <span class="input-group-addon">次则禁用</span>
                                            <select name="punishment" class="form-control input-sm">
                                                <option value="5">5分钟</option>
                                                <option value="10" selected="selected">10分钟</option>
                                                <option value="30">半小时</option>
                                                <option value="60">1小时</option>
                                                <option value="720">12小时</option>
                                                <option value="1440">24小时</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {/foreach}
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <button type="button" class="btn btn-default xsui-btn-close-dialog">取消</button>
                        <button type="submit" class="btn btn-primary pull-right">保存</button>
                    </div>
                    <!-- /.box-footer -->
                    <input type="hidden" name="id" value="{$data.id}"/>
                </form>
            </div>
        </div>
    </div>
    {/block}
    {block name="script_before"}
    <script>
        xsApp.xsfnUploadButtonInit();
        /**
         * 单文件上传回调函数
         * @param {type} name
         * @param {type} value
         * @returns {undefined}
         * @version 1.0 2016-12-15
         */
        function single_uploader_cb(name, value) {
            var $input = $('[name="' + name + '"]');
            $input.val(value)
            //$input.parent().parent().find('img').attr('src', value).parent().attr({'href': value, 'title': value}).next().data('url', value);
            layer.closeAll();
            //$('iframe').parent().dialog('close');
        }
    </script>
    {/block}